var imgUp = "../images/arrowUp.gif";
var imgDn = "../images/arrowDn.gif";

//默认点击了head2
function init() {
	
	document.onclick = doClick;
	expandIt("head2");
	
	window.top.document.getElementById("main").src = "user_list.jsp";
	//detail.setAttribute("src","user_list.jsp");
}


function expandIt(head) {
	console.log("expandIt(" + head + ")");
	var bulletImg = null;
	//获取一个dom元素： document.getElementById('head2Parent');
	var parentDiv = document.getElementById(head + "Parent");
	var childDiv = document.getElementById(head + "Child");//"head2Child"
	var	bulletImg = parentDiv.getElementsByTagName("img");

	//收起菜单
	if(childDiv.style.display == "block") { 
		childDiv.style.display = "none";
		bulletImg.src = imgDn;
	
	//展开菜单
	} else { 
		childDiv.style.display = "block";
		bulletImg.src = imgUp;
	}
	return false; // cancels event 阻止事件提交
}

function doClick() {
	
	console.log("doClick-->");
	
	el = event.srcElement;
	while (el && el.tagName != "A") {
		el = el.parentElement;
	}
	if (!el)
		return;
	if (el.target != "main")
		return;
	hiliteSel(el);
}
var prevSel = null;
function hiliteSel(selLink) {
	var selColor = "red";
	if (prevSel) {
		prevSel.style.color = prevSel.prevColor;
	}
	prevSel = selLink;
	prevSel.prevColor = selLink.style.color;
	selLink.style.color = selColor;
}




if (screen.colorDepth > 8) {
	// document.write(
	// "<STYLE>BODY{background-image:url(/images/ai/tile_nav.jpg);}</STYLE>" );
}
//var licenseID = '01-0006-0038-69648';
//var pendingChanges = false;
